"""关怀页面"""
from time import sleep

from selenium.webdriver.common.by import By

from page.base_page import BasePage


class CarePage(BasePage):
    url="/index.php?m=customer&a=cares"
    #定位器
    add_care_locator=(By.CSS_SELECTOR,"body > div.container > div.row > div:nth-child(1) > div > a")
    first_locator = (By.CSS_SELECTOR, "#form1 > table > tbody > tr:nth-child(1) > td:nth-child(1) > input")
    delete_locator = (By.CSS_SELECTOR, "#delete")
    #方法
    def delete_first(self):
        #删除第一个数据
        self.find_element(self.first_locator).click()
        self.find_element(self.delete_locator).click()
        self.driver.switch_to.alert.accept()
        sleep(2)
    def click_add_care(self):
        #点击添加客户关怀
        self.find_element(self.add_care_locator).click()

